"""
矩阵右旋 90 度演示
"""

import pygame
from box import Box

pygame.init()
screen = pygame.display.set_mode((600, 600))
pygame.display.set_caption("Rotate Matrix demo")

box = Box()

clock = pygame.time.Clock()

running = True
while running:
    for event in pygame.event.get():
        if event.type == pygame.QUIT:
            running = False
            break

    # --------------- event  ---------------
    key_pressed = pygame.key.get_pressed()

    # --------------- update  ---------------
    box.update(key_pressed)

    # --------------- draw  ---------------
    screen.fill((255, 255, 255))

    box.draw(screen)

    pygame.display.flip()

    # --------------- clock  ---------------
    clock.tick(60)

pygame.quit()

